//----------------------------------*-C++-*----------------------------------//
/*!
 * \file   Traits.hh
 * \author Jeremy Roberts
 * \date   Jul 3, 2011
 * \brief  Collection of traits
 * \note   Copyright (C) 2011 Jeremy Roberts. 
 */
//---------------------------------------------------------------------------//
// $Rev::                                               $:Rev of last commit
// $Author::                                            $:Author of last commit
// $Date::                                              $:Date of last commit
//---------------------------------------------------------------------------//

#ifndef TRAITS_HH_
#define TRAITS_HH_

#include "../utilities/Vector_Lite.hh"

namespace slabtran
{

//===========================================================================//
/*!
 * \class Dimension
 * \brief Allows templates using dimension without <int N> format.
 *
 * There may eventually be further uses for the class.
 *
 * Idea taken from S. Johnson's code PyTRT.
 *
 */
//===========================================================================//
template <int N>
class Dimension
{
public:
	typedef int value_type;
	static const value_type dimension = N;
};
// instantiations
typedef Dimension<1> _1D;
typedef Dimension<2> _2D;
typedef Dimension<3> _3D;

//===========================================================================//
/*!
 * \class DimVectorTraits
 * \brief Defines an appropriate dimensioned vector
 *
 * \param T  type of elements
 * \param D  spatial dimension
 *
 */
//===========================================================================//
template <class T, class D>
class DimVectorTraits
{
public:
	typedef util::Vector_Lite<T, D::dimension> 	DimVector;
	typedef T 									value_type;
};

template <class T>
class DimVectorTraits<T,_1D>
{
public:
	typedef T            	DimVector;
	typedef T 				value_type;
};

//template <>
//class DimVectorTraits<int,_1D>
//{
//public:
//	typedef int         	DimVector;
//	typedef int 			value_type;
//};
//
//template <>
//class DimVectorTraits<double,_1D>
//{
//public:
//	typedef double         	DimVector;
//	typedef double			value_type;
//};


} // end namespace slabtran


#endif /* TRAITS_HH_ */

//---------------------------------------------------------------------------//
//              end of Traits.hh
//---------------------------------------------------------------------------//
